<?php
require_once("Includes/connection.php");
require_once("Includes/functions.php");
$entry_date=array();
$entry_from=array();
$entry_answer=array();
get_poll_data($_GET['short_name'], $entry_date, $entry_from, $entry_answer);
$query = sprintf("SELECT * FROM polls WHERE short_name='%s'",$_GET['short_name']);
$result = mysql_query($query);
$info = mysql_fetch_assoc($result);
$end = $info['time_end'];
$start = $info['time_start'];
if($info['multiple_entries']=='No'){
	delete_multiple_entries($entry_date, $entry_from, $entry_answer);
}
if($info['sms_entries']=='No'){
	delete_sms_entries($entry_date, $entry_from, $entry_answer);
}
if($info['web_entries']=='No'){
	delete_web_entries($entry_date, $entry_from, $entry_answer);
}
header("Content-Type: text/xml");
echo "<data>";
for($i=0; $i<count($entry_date); $i++){		
	echo "<entry>";
	echo '<date>'.$entry_date[$i].'</date>';
	echo '<from>'.$entry_from[$i].'</from>';
	echo '<answer>'.$entry_answer[$i].'</answer>';
	echo "</entry>";
}
echo "</data>";
?>